<div id="mainMenu">
<?php
	/* INICIO MENU WEB SITE */
	$group = $othAuth->getData('group');
	$level =$group['level'];
	$organization = $othAuth->getData("organization");
	if ($level <= 201 && $level > 2) {
		echo "<h3 class='bg1'>página web</h3>";
		echo "<ul>";
		echo "<li><a href=".$html->url('/cmsconfigurations/edit').">Página Principal</a></li>";
		echo "<li><a href=".$html->url('/profiles/edit').">Perfil</a></li>";
		echo "<li><a href=".$html->url('/webs/albuns/').">Albuns</a></li>";
		echo "<li><a href=".$html->url('/videos/index').">Videos</a></li>";
		echo "<li><a href=".$html->url('/webs/calendar').">Eventos</a></li>";
		echo "<li><a href=".$html->url('/arquivos/index').">Downloads</a></li>";
		echo "<li><a href=".$html->url('/webs/index_atividade/').">Atividades</a></li>";
		echo "<li><a href=".$html->url('/webs/index_apoio/').">Apoio</a></li>";
		echo "</ul>";
	}

	/* FINAL MENU WEB SITE */

	$group = $othAuth->getData('group');
	$level =$group['level'];

	echo "<h3 class='bg1'>administração</h3>";
	echo "<ul>";
	echo "<li><a href=".$html->url('/users/home/index').">Página Principal</a></li>";

	if ($level >= 100) {
		$organization = $othAuth->getData("organization");
		echo "<li><a href=".$html->url('/organizations/view/'.$organization['id']).">Minha entidade</a></li>";
	} else {
		if ($othAuth->hasPermission('organizations/index')) {
			echo "<li><a href=".$html->url('/organizations/index').">Entidades</a></li>";
		}
	}

	if ($othAuth->hasPermission('units/index')) {
		echo "<li><a href=".$html->url('/units/index').">Unidades</a></li>";
	}

	if ($othAuth->hasPermission('employees/index')) {
		echo "<li><a href=".$html->url('/employees/index').">Funcionários</a></li>";
	}

	if ($othAuth->hasPermission('volunteers/index')) {
		echo "<li><a href=".$html->url('/volunteers/index').">Voluntários</a></li>";
	}

	if ($othAuth->hasPermission('assistidos/index')) {
		echo "<li><a href=".$html->url('/assistidos/index').">Assistidos</a></li>";
	}

	if ($othAuth->hasPermission('forums/index')) {
		echo "<li><a href=".$html->url('/forums/index').">Fórum</a></li>";
	}

	if ($othAuth->hasPermission('noticias/index')) {
		echo "<li><a href=".$html->url('/noticias/index')."> Notícias </a></li>";
	}

	echo "<li><a href=".$html->url('/messages/').">Mensagens</a></li>";

	if ($othAuth->hasPermission('events')) {
		echo "<li><a href=".$html->url('/events/calendar').">Eventos</a></li>";
	}

	if ($othAuth->hasPermission('calendars')) {
		echo "<li><a href=".$html->url('/calendars/').">Calendários</a></li>";
	}
	
	echo "</ul>";

	$group = $othAuth->getData('group');
	$level =$group['level'];
	if ($level <= 400) {
?>
	<h3 class="bg1">configuração adm</h3>
	<ul>
	<li><a href="<?php echo $html->url('/formularios/'); ?>">Formulários</a></li>
	<li><a href="<?php echo $html->url('/ftemplates/'); ?>">Formulários - Modelos</a></li>
	</ul>
<?php
}

if ($level == 1) {
?>
<h3 class="bg1">Sistema</h3>
<ul>
<li><a href="<?php echo $html->url('/groups/'); ?>">Grupos de permissões</a></li>
<li><a href="<?php echo $html->url('/permissions/'); ?>">Permissões</a></li>
<li><a href="<?php echo $html->url('/cidades/'); ?>">Cidades</a></li>
<li><a href="<?php echo $html->url('/estados/'); ?>">Estados</a></li>
</ul>
<?php
}
?>

</div>
